<?php
	session_start();
	if(!$_SESSION['login'] == 1 && $_SESSION['sessionid'] !== session_id()) {
		header("Location: ./");
		exit;
	}
	
	include("include/class.mysql.php");
	include("include/layout.php");

	html_start();
	
	$id = $_GET['id'];
	$user_group = $_SESSION['group'];
	
	if(isset($id)) {
		if(!is_numeric($id)) {
			print "Id must be numeric!";
			exit;
		}
		
		else {
			$MySQL->conn();
			$sql = mysql_query("SELECT * FROM " . DB_PREFIX . "contacts WHERE id = '$id'") or die(mysql_error());
			
			while($row = mysql_fetch_array($sql)) {
				if($row['user_group'] !== $user_group) {
					print "This contact does not belong to your group!";
					exit;
				}
?>

	<br />
	<span class="conin">

 

	<td style="vertical-align:top;">




						<fieldset style="width:250px;
						<?php
							if(empty($row['ph_home']) && empty($row['ph_work']) && empty($row['ph_mobile'])) {
								echo "display:none;";
								$disp3 = false;
							}
						?>">
							<legend><?=ADDR_PHONE;?></legend>
							<table>
							<?if(!empty($row['ph_home'])) {?>
							<tr><td><b><?=ADDR_HOME;?>:

</b></td></tr>
							<tr><td><?=strip_tags($row['ph_home']);?>

<br />
<?php
$variavel=strip_tags($row['ph_home']);
$mobile = $_POST["mobile"];
$message = $_POST["message"];
if (!isset($_POST['submit'])) {}
?>
<form method="post" action="sendsms.php">
<br />
Numero:<input type="text" value=<?=$variavel;?> size="12" maxlength="12" name="mobile">:<br />
<textarea rows="5" cols="20" name="message" wrap="physical">Enter your message!</textarea>:<br />

<input type="submit" value="Send Sms" name="submit"><br />
</form><br />

</td></tr>
							<?}?>
							<?if(!empty($row['ph_work'])) {?>
							<tr><td><b><?=ADDR_WORK;?>:</b></td></tr>
							<tr><td><?=strip_tags($row['ph_work']);?>
<?php
$variavel=strip_tags($row['ph_work']);
$mobile = $_POST["mobile"];
$message = $_POST["message"];
if (!isset($_POST['submit'])) {}
?>
<form method="post" action="sendsms.php">
<br />
Numero:<input type="text" value=<?=$variavel;?> size="12" maxlength="12" name="mobile">:<br />
<textarea rows="5" cols="20" name="message" wrap="physical">Enter your message!</textarea>:<br />

<input type="submit" value="Send Sms" name="submit"><br />
</form><br />

</td></tr>
							<?}?>
							<?if(!empty($row['ph_mobile'])) {?>
							<tr><td><b><?=ADDR_MOBILE;?>:</b></td></tr>
							<tr><td><?=strip_tags($row['ph_mobile']);?>
<?php
$variavel=strip_tags($row['ph_mobile']);
$mobile = $_POST["mobile"];
$message = $_POST["message"];
if (!isset($_POST['submit'])) {}
?>
<form method="post" action="sendsms.php">
<br />
Numero:<input type="text" value=<?=$variavel;?> size="12" maxlength="12" name="mobile">:<br />
<textarea rows="5" cols="20" name="message" wrap="physical">Enter your message!</textarea>:<br />

<input type="submit" value="Send Sms" name="submit"><br />
</form><br />


</td></tr>

<tr>
    <td valign=top><strong>Sites:</strong></td>
    <td> <select name="cities">
    <option selected>Select</option>
    <option><?=$variavel;?></option>
    <option>Paris</option>
    <option>New York</option>
    </select>
    </tr>
    </td>





							<?}?>
							</table>
						</fieldset>
						<?php
						if($disp3 !== false) {
						?>
						<br />
						<?php
						}
						?>
						<fieldset style="width:250px;
						<?php
							if((empty($row['mail'])) && (empty($row['msn'])) && (empty($row['icq'])) && (empty($row['ym'])) && (empty($row['web']))) {
								echo "display:none;";
							}
						?>">
							<legend><?=ADDR_ELECTRON;?></legend>
							<table style="width:250px;">
							<?if(!empty($row['web'])) {?>
							<tr>
								<td style="width:20px;">
									<img src="img/homepage_icon.gif" alt="Homepage" />
								</td>
								<td>
									<?="<a href=\"http://" . strip_tags($row['web']) . "\">" . strip_tags($row['web']) . "</a>";?>
								</td>
							</tr>
							<?}?>
							<?if(!empty($row['mail'])) {?>
							<tr>
								<td style="width:20px;">
									<img src="img/mail.gif" alt="Mail" />
								</td>
								<td>
									<?=strip_tags($row['mail']);?>
								</td>
							</tr>
							<?}?>
							<?if(!empty($row['msn'])) {?>
							<tr>
								<td style="width:20px;">
									<img src="img/icon_msn.gif" alt="MSN Messenger" />
								</td>
								<td>
									<?=strip_tags($row['msn']);?>
								</td>
							</tr>
							<?}?>
							<?if(!empty($row['icq'])) {?>
							<tr>
								<td style="width:20px;">
									<img src="img/icq.gif" alt="ICQ" />
								</td>
								<td>
									<?=strip_tags($row['icq']);?>
								</td>
							</tr>
							<?}?>
							<?if(!empty($row['ym'])) {?>
							<tr>
								<td style="width:20px;">
									<img src="img/yahoo.gif" alt="Yahoo IM" />
								</td>
								<td>
									<?=strip_tags($row['ym']);?>
								</td>
							</tr>
							<?}?>
							</table>
						</fieldset>
					</td>
				</tr>
			</table>
	</span>
<?php
			}
		}
	}
			
			$MySQL->close();
			
	html_end();
?>